package com.ithema.exception;

public class BusinessException extends RuntimeException{
    //定义异常编号
    private Integer code;

    //然后生成父类构造方法，这里构造方法按业务所需
    
    public BusinessException(Integer code,String message) {
        super(message);
        this.code = code;
    }

    public BusinessException(Integer code,String message, Throwable cause) {
        super(message, cause);
        this.code = code;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    @Override
    public String getMessage() {
        return super.getMessage();
    }

    /*             先不用的进行注释
    public BusinessException(Integer Integer) {
        this.Integer = Integer;
    }
    
     public BusinessException(Throwable cause, Integer Integer) {
        super(cause);
        this.Integer = Integer;
    }

    public BusinessException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace, Integer Integer) {
        super(message, cause, enableSuppression, writableStackTrace);
        this.Integer = Integer;
    }
    
    */
}
